home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWODUtil / Include / FWODGeom.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.9 KB  |  110 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWODGeom.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWODGEOM_H
  11. #define FWODGEOM_H
  12.  
  13. #if FW_LIB_EXPORT_PRAGMAS
  14. #pragma lib_export on
  15. #endif
  16.  
  17. //========================================================================================
  18. //    Forward Declarations
  19. //========================================================================================
  20.  
  21. class FW_CLASS_ATTR ODFrame;
  22. class FW_CLASS_ATTR ODShape;
  23. class FW_CLASS_ATTR ODTransform;
  24.  
  25. class FW_CLASS_ATTR FW_CRect;
  26. class FW_CLASS_ATTR FW_CPoint;
  27.  
  28. struct FW_CLASS_ATTR FW_SPlatformRect;
  29. struct FW_CLASS_ATTR FW_SPlatformPoint;
  30.  
  31. //========================================================================================
  32. //    Global Utilities
  33. //========================================================================================
  34.  
  35. FW_FUNC_ATTR void              FW_PrivCreateShapeTransformMaker(Environment *ev, ODFrame* odFrame);
  36.  
  37. //########################################################################################
  38. // SCpp Hack
  39. // Work around SCpp 8.0.3 bug - importing overloaded functions doesn't work.
  40. // Replace overloaded functions with normal functions with different names.
  41. // Use inline overloaded functions which turn around and call the renamed
  42. // functions so client code isn't affected.
  43. //########################################################################################
  44.  
  45. // ----- ODShape utilities -----
  46.  
  47. FW_FUNC_ATTR ODShape*          FW_NewODShape_Empty(Environment* ev);
  48. FW_FUNC_ATTR ODShape*        FW_NewODShape_Shape(Environment *ev, ODShape* otherShape);
  49. FW_FUNC_ATTR ODShape*        FW_NewODShape_Rect(Environment *ev, const FW_CRect& rect);
  50. FW_FUNC_ATTR ODShape*        FW_NewODShape_PlatformRect(Environment *ev, const FW_SPlatformRect& rect);
  51. FW_FUNC_ATTR ODShape*        FW_NewODShape_Region(Environment *ev, ODRgnHandle rgnHandleToAdopt);
  52.  
  53. FW_FUNC_ATTR ODRgnHandle    FW_GetShapeRegion(Environment *ev, ODShape* odShape);
  54. FW_FUNC_ATTR void             FW_SetShapeRegion(Environment *ev, ODShape* odShape, ODRgnHandle rgnHandle);
  55.  
  56. FW_FUNC_ATTR FW_CRect        FW_GetShapeBoundingBox(Environment *ev, ODShape* odShape);
  57.  
  58. // ----- ODTransform utilities -----
  59.  
  60. FW_FUNC_ATTR ODTransform*      FW_NewODTransform_Empty(Environment* ev);
  61. FW_FUNC_ATTR ODTransform*     FW_NewODTransform_Transform(Environment *ev, ODTransform* otherTransform);
  62. FW_FUNC_ATTR ODTransform*     FW_NewODTransform_Point(Environment *ev, const FW_CPoint& offset);
  63. FW_FUNC_ATTR ODTransform*     FW_NewODTransform_Point2(Environment *ev, const FW_CPoint& offset, const FW_CPoint& scale);
  64.  
  65. #if FW_LIB_EXPORT_PRAGMAS
  66. #pragma lib_export off
  67. #endif
  68.  
  69. // SCpp Hack
  70.  
  71. inline ODShape* FW_NewODShape (Environment* ev) {
  72.     return FW_NewODShape_Empty (ev);
  73. }
  74.  
  75. inline ODShape*    FW_NewODShape (Environment *ev, ODShape* otherShape) {
  76.     return FW_NewODShape_Shape (ev, otherShape);
  77. }
  78.  
  79. inline ODShape*    FW_NewODShape (Environment *ev, const FW_CRect& rect) {
  80.     return FW_NewODShape_Rect (ev, rect);
  81. }
  82.  
  83. inline ODShape*    FW_NewODShape (Environment *ev, const FW_SPlatformRect& rect) {
  84.     return FW_NewODShape_PlatformRect (ev, rect);
  85. }
  86.  
  87. inline ODShape*    FW_NewODShape (Environment *ev, ODRgnHandle rgnHandleToAdopt) {
  88.     return FW_NewODShape_Region (ev, rgnHandleToAdopt);
  89. }
  90.  
  91.  
  92. inline ODTransform* FW_NewODTransform (Environment* ev) {
  93.     return FW_NewODTransform_Empty (ev);
  94. }
  95.  
  96. inline ODTransform* FW_NewODTransform (Environment *ev, ODTransform* otherTransform) {
  97.     return FW_NewODTransform_Transform (ev, otherTransform);
  98. }
  99.  
  100. inline ODTransform* FW_NewODTransform (Environment *ev, const FW_CPoint& offset) {
  101.     return FW_NewODTransform_Point (ev, offset);
  102. }
  103.  
  104. inline ODTransform* FW_NewODTransform (Environment *ev, const FW_CPoint& offset, const FW_CPoint& scale) {
  105.     return FW_NewODTransform_Point2 (ev, offset, scale);
  106. }
  107.  
  108. #endif
  109.  
  110.